#pragma once

#include "rule.hh"
#include "rating.hh"

#include <string>
#include <memory>
#include <vector>

enum class WorkflowResult
{
    Accept,
    Reject,
    Jump,
};

class Workflow
{
public:
    Workflow(const std::string& line);
    Workflow(const Workflow&) = delete;
    Workflow(Workflow&&) noexcept = default;

public:
    void print() const;
    auto result(Rating* rating) const -> std::tuple<WorkflowResult, std::string>;

public:
    const std::string& name() const noexcept
    { return this->_name; }

private:
    std::string _name;
    std::vector<std::unique_ptr<Rule>> _rules;
};
